package com.xingda.packing.dmds.enums;

import lombok.Getter;

public enum TaskUploadState {

    SUCCESS(1, "上传成功"),
    FAIL(0, "上传失败"),
    OTHER(99, "未知"),
    NOT_UPLOAD(2, "未上传");

    TaskUploadState(int number, String desc) {
        this.number = number;
        this.desc = desc;
    }

    @Getter
    private final int number;

    @Getter
    private final String desc;

    public static TaskUploadState getById(int id) {
        for (TaskUploadState value : TaskUploadState.values()) {
            if (value.getNumber() == id) {
                return value;
            }
        }
        return OTHER;
    }

}
